{php}
    $field['config']['group'] = isset($field['config']['group'])?$field['config']['group']:0;
    $field['config']['tree'] = isset($field['config']['tree'])?$field['config']['tree']:0;
    $field['config']['rootitem'] = isset($field['config']['rootitem'])?$field['config']['rootitem']:0;
    $field['config']['editable'] = isset($field['config']['editable'])?$field['config']['editable']:0;
    $_where = [];
    if ($field['config']['queryparams']) {
        $_queryparams = explode(PHP_EOL,\ebcms\Func::streol($field['config']['queryparams']));
        foreach ($_queryparams as $key => $value) {
            $_tmp = explode('|',$value);
            if (stripos($_tmp[2],'(I)') === 0) {
                $_tmp[2] = input(substr($_tmp[2],3));
            }elseif(stripos($_tmp[2],'(@)') === 0){
                $_tmp[2] = $data[substr($_tmp[2],3)];
            }elseif(stripos($_tmp[2],'($)') === 0){
                $_tmp[2] = \ebcms\Func::get_point_value($data,substr($_tmp[2],3));
            };
            $_where[$_tmp[0]]= [$_tmp[1],$_tmp[2]];;
        }
    };
    $_m = \think\Loader::model($field['config']['model']);
    $_dat = $_m -> order('sort desc,id asc') -> where($_where) -> select();
    $_str = \ebcms\Func::select($_dat,$field['config'],$field['value']);
{/php}
{eq name='field.config.editable' value='1'}
    <table class="table" style="margin-bottom: 0px;">
        <tr>
            <td style="padding: 0px !important;">
                <input type="text" class="form-control" id="{$field.unique}_obj" name="{$field.field}" value="{$field.value}" placeholder="{$field.config.prompt|default=''}" {eq name='field.config.readonly' value='1'} readonly{/eq} {eq name='field.config.disabled' value='1'} disabled{/eq}>
            </td>
            <td style="width: 150px;padding: 0px 0px 0px 10px !important;">
                <select class="form-control" id="{$field.unique}" onchange="$('#{$field.unique}_obj').val($(this).val());" {eq name='field.config.readonly' value='1'} readonly{/eq} {eq name='field.config.disabled' value='1'} disabled{/eq}>
                    {$_str}
                </select>
            </td>
        </tr>
    </table>
{else/}
    <select class="form-control" id="{$field.unique}" name="{$field.field}" {eq name='field.config.readonly' value='1'} readonly{/eq} {eq name='field.config.disabled' value='1'} disabled{/eq}>
        {$_str}
    </select>
{/eq}